﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using Autodesk.Revit.DB;
using YArchitech.LIB;

namespace HYView
{
	public partial class FormFamily3DView : System.Windows.Forms.Form
	{
		public FormFamily3DView()
		{
			this.InitializeComponent();
			//base.Icon = Resource.YArchitechIcon;
		}

		public void UpdateElementHost(Document doc, FamilySymbol fs)
		{
			this.fh = new Family3DViewHelper();
			this.fh.InitPreviewControl(doc, fs, this.elementHost);
			this.groupBox.Text = "族名称:" + fs.Family.Name;
		}

		[DllImport("user32.dll")]
		public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);

		[DllImport("user32.dll", EntryPoint = "SendMessageA")]
		public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);

		private void FormFamily3DView_MouseLeave(object sender, EventArgs e)
		{
		}

		private void FormFamily3DView_Leave(object sender, EventArgs e)
		{
		}

		private void FormFamily3DView_FormClosed(object sender, FormClosedEventArgs e)
		{
		}

		private void btnCancle_Click(object sender, EventArgs e)
		{
			base.Close();
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Abort;
		}

		private Family3DViewHelper fh;
	}
}
